package org.site.eclipse;

import CarProject.*;

public class EclipseProject
{
  protected static String nl;
  public static synchronized EclipseProject create(String lineSeparator)
  {
    nl = lineSeparator;
    EclipseProject result = new EclipseProject();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<projectDescription>" + NL + "        <name>";
  protected final String TEXT_2 = "</name>" + NL + "        <comment></comment>" + NL + "        <projects>" + NL + "        </projects>" + NL + "        <buildSpec>" + NL + "                <buildCommand>" + NL + "                        <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>" + NL + "                        <triggers>full,incremental,</triggers>" + NL + "                        <arguments>" + NL + "                                <dictionary>" + NL + "                                        <key>LaunchConfigHandle</key>" + NL + "                                        <value>&lt;project&gt;/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch</value>" + NL + "                                </dictionary>" + NL + "                        </arguments>" + NL + "                </buildCommand>" + NL + "                <buildCommand>" + NL + "                        <name>org.eclipse.jdt.core.javabuilder</name>" + NL + "                        <arguments>" + NL + "                        </arguments>" + NL + "                </buildCommand>" + NL + "                <buildCommand>" + NL + "                        <name>org.eclipse.wst.common.project.facet.core.builder</name>" + NL + "                        <arguments>" + NL + "                        </arguments>" + NL + "                </buildCommand>" + NL + "                <buildCommand>" + NL + "                        <name>org.eclipse.wst.validation.validationbuilder</name>" + NL + "                        <arguments>" + NL + "                        </arguments>" + NL + "                </buildCommand>" + NL + "        </buildSpec>" + NL + "        <natures>" + NL + "                <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>" + NL + "                <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>" + NL + "                <nature>org.eclipse.wst.common.project.facet.core.nature</nature>" + NL + "                <nature>org.eclipse.jdt.core.javanature</nature>" + NL + "                <nature>org.eclipse.wst.jsdt.core.jsNature</nature>                                                                                                                                                             " + NL + "        </natures>                                                                                                                                                                                                              " + NL + "</projectDescription>";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     SiteWeb project = (SiteWeb) argument; 
    stringBuffer.append(TEXT_1);
    stringBuffer.append(project.getNom());
    stringBuffer.append(TEXT_2);
    return stringBuffer.toString();
  }
}
